/*
	File:		IGameStateMachine.h
	Author:		Arturo Mata, dmonroe
	Date:		11/4/2012
	Copyright:	Full Sail University

	Purpose:	General purpose game state machine which switches between IGameStates
*/

#ifndef IGAMESTATEMACHINE_H
#define IGAMESTATEMACHINE_H


// Forward declaration
class IGameState;



class IGameStateMachine
{
public:
	// SINGLETON
	static IGameStateMachine*	GetInstance		( void );
	static void					DeleteInstance	( void );

	// SETUP
	virtual bool		Initialize		( void )	= 0;
	virtual bool		Terminate		( void )	= 0;
	
	// STATE ID
	enum EStateID		{ E_MAINMENU, E_GAMEPLAY, E_OPTIONS, E_HOWTOPLAY, E_HIGHSCORES, E_CREDITS };
	virtual bool		RegisterState	( EStateID ID, IGameState* (*pFunction)( void ) )	= 0;

	// STATE MACHINE
	virtual bool		SwitchState		( EStateID ID )		= 0;
	virtual bool		PushState		( EStateID ID )		= 0;
	virtual bool		PopState		( void )			= 0;
	virtual bool		PopAllStates	( void )			= 0;

	// FRAME UPDATE
	virtual bool		Input			( float fElapsedTime )	= 0;
	virtual bool		Update			( float fElapsedTime )	= 0;
	virtual bool		Render			( float fElapsedTime )	= 0;


protected:
	IGameStateMachine			( void )			// Default constructor
		{	/* do nothing*/		}
	virtual ~IGameStateMachine	( void )			// Destructor
		{	/* do nothing*/		}

private:
	IGameStateMachine			( const IGameStateMachine& GSM );	// Copy constructor
	IGameStateMachine& operator=( const IGameStateMachine& GSM );	// Assignment operator
};

#endif //IGAMESTATEMACHINE_H